package com.jxrj.interaction.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MyWebAppConfigurer implements WebMvcConfigurer {
    /**
     * 动态文件配置:用于设置头像等动态展示图片展示地址
     *
     * @author: @黄泽森
     * @create: 2022年7月7日15:58:18
     */
    //头像展示地址: localhost:port/HeadIcon/imgid.格式
    @Autowired
    FileSaveAddress f;
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("HeadIcon/**").addResourceLocations(f.getFilePath());
    }
}
